<template>
	<view class="content">
		<view class="top_nav">
			<view class="kong"></view>
			<!-- <image src="../../static/buy/1.png"></image> -->
			<view class="tab_item">
				<view class="return" @click="returnPage">
					<image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/course/jiantou.png">
					</image>
				</view>
				<view class="title">分享海报</view>
				<view class="return"></view>
			</view>
			<movable-area class="t1">
				<movable-view out-of-bounds="true" class="imgbox" :style="imgboxStyle" direction="horizontal">
					<template v-for="(item, index) in imgs">
						<image @click="select(item)" mode="heightFix" :key="index"
							style="height:230rpx;margin-left:50rpx;" :src="item.url" lazy-load="true"></image>
					</template>
				</movable-view>
			</movable-area>
		</view>

		<view class="mainbox">
			<view class="box">
				<image class="curimg" mode="heightFix" :src="curimg" lazy-load="true"></image>
					<button open-type='share' class='but' hover-class='none'>分享给好友</button>
			</view>
		</view>
	</view>
</template>

<script>
	// 引入方法
	import appShare, {
		closeShare
	} from "@/js_sdk/zhouWei-APPshare/plugins/share/index.js"
	export default {
		data() {
			return {
				member_id: '',
				model: 1,
				curimg: 'https://wanxian-test.oss-cn-shenzhen.aliyuncs.com/6623.png',
				imgs: [{
						url: 'https://wanxian-test.oss-cn-shenzhen.aliyuncs.com/6623.png'
					},
					{
						url: 'https://wanxian-test.oss-cn-shenzhen.aliyuncs.com/6623.png'
					},
					{
						url: 'https://wanxian-test.oss-cn-shenzhen.aliyuncs.com/6623.png'
					}
				],
				shareObj: null,
				imgboxStyle: {
					"width": "400vw"
				},
				gzhImg: ''
			}
		},
		onShareAppMessage(res) {
			this.member_id = uni.getStorageSync("member_id")
			console.log(666,this.member_id)
			this.$forceUpdate();
			return {
				title: '好友邀请一起来拿588元红包',
				path: '/activePages/pages/index_add_user_info/index_add_user_info?member_id='+ this.member_id,
				imageUrl: this.curimg,
			}
		},
		onLoad() {

		},
		onBackPress() {
			this.shareObj.close();
		},
		methods: {
			returnPage() {
				uni.navigateBack({
					delta: 1
				})
			},
			select(item) {
				this.model = item.index;
				this.curimg = item.url;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100vw;
		position: relative;

		.top_nav {
			width: 100vw;
			height: 560upx;
			background-image: url('https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/new_saas/zwnl/8.png');
			background-size: 750upx 400upx;
			position: fixed;
			top: 0;
			left: 0;
			z-index: 10;

			.kong {
				width: 100vw;
				height: 60upx;
			}

			.tab_item {
				width: 90vw;
				margin: 0 auto;
				height: 100upx;
				display: flex;
				align-items: center;
				justify-content: center;

				.return {
					flex: 1;
					width: 100vw;

					image {
						width: 29upx;
						height: 29upx;
					}
				}

				.title {
					flex: 8;
					width: 100vw;
					color: #ffffff;
					display: flex;
					align-items: center;
					justify-content: center;
					z-index: 10;
				}
			}

			.t1 {
				width: 100vw;
				margin-top: 10rpx;
				height: 330rpx;

				.imgbox {
					width: 365vw;
					height: 100vh;
				}
			}
		}

		.mainbox {
			width: 100vw;
			height: 100vh;
			background-image: url('https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/buy/03.png');
			background-size: 100vw 100vh;
			padding-top: 700rpx;

			.box {
				height: 60vh;
				width: 90vw;
				position: relative;
				top: -250rpx;
				background-image: url('https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/buy/04.png');
				background-size: 90vw 105vh;
				z-index: 10;
				margin-left: 5vw;
				border-radius: 30rpx;
				text-align: center;

				.curimg {
					display: inline-block;
					height: 50vh;
					margin-top: 5vh;
				}

				.but {
					background-image: url('https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/buy/05.png');
					background-size: 100% 100%;
					width: 400rpx;
					height: 140rpx;
					font-size: 1.6em;
					color: white;
					background-color: rgba(255, 255, 255, 0);
				}

				.but:after {
					border: none;
				}
			}
		}
	}
</style>
